package city.spring.modules.oldman.repository;

import city.spring.modules.oldman.entity.OldmanLeaveApplyEntity;
import city.spring.modules.oldman.vo.OldmanLeaveApplyEntityVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 存储库：退住申请
 *
 * @author pxm
 * @date 2020-09-30 09:51:23
 */
@Repository
public interface OldmanLeaveApplyRepository extends BaseMapper<OldmanLeaveApplyEntity> {
    /**
     * 退住申请记录
     *
     * @param page
     * @param wrapper
     * @return
     */
    IPage<OldmanLeaveApplyEntityVO> listPage(Page<? extends OldmanLeaveApplyEntity> page, @Param(Constants.WRAPPER) Wrapper<? extends OldmanLeaveApplyEntity> wrapper);

    /**
     * 根据老人ID 获取申请记录
     *
     * @param oldmanId
     * @return
     */
    OldmanLeaveApplyEntity getByOldmanId(String oldmanId);
}